package com.sky.controller.admin;

import com.sky.dto.DishDTO;
import com.sky.dto.DishPageQueryDTO;
import com.sky.result.Result;
import com.sky.service.DishService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/dish")
public class DishController {
    @Autowired
    private DishService dishService;
    /**
     * 菜品分页查询
     * @param dto
     * @return
     */
    @GetMapping("/page")
    public Result pageDish(DishPageQueryDTO dto){

        return dishService.pageDish(dto) ;
    }

    /**
     * 根据id查询菜品
     * @param dishPageQueryDTO
     * @return
     */
    @GetMapping("/list")
    public Result listDish(DishPageQueryDTO dishPageQueryDTO){
        return listDish(dishPageQueryDTO);
    }
}
